<?php
require_once "model/RequestHandler.php";

class EntitlementValidator{

	private $request_handler;
	function __construct($request_handler){
		$this->request_handler = $request_handler;
	}

	public function has_entitlement(){
		$has_entitlements = true;
		$request = $this->request_handler->get_request();
		$matches = preg_match('/^site\./', $request); //TODO move to a configurable way
		
		if($matches != 0 && !isset($_SESSION['user_id'])){
			$has_entitlements = false;
		}
		return $has_entitlements;
	}
}
?>
